<nav class="navbar navbar-default navbar-static" role="navigation" ng-controller="NavController" ng-app="common.controllers">
    <div class="navbar-header">
        <button class="navbar-toggle" type="button" data-toggle="collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">Search Admin</a>
    </div>
    <div class="collapse navbar-collapse" ng-show="currentPath != '/login'">
        <ul class="nav navbar-nav">
            <li ng-repeat="menu in menus"
                ng-class="{active : activeView == menu.name, dropdown : hasChild(menu)}">
                <a href="#{{ menu.url }}" ng-if="!hasChild(menu)" ng-bind="menu.name"></a>
                <a href="javascript:void(0)" role="button" class="dropdown-toggle" data-toggle="dropdown" ng-if="hasChild(menu)">{{ menu.name }}<span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu" ng-if="hasChild(menu) && menu.type==1">
                    <li role="presentation" ng-repeat="subMenu in menu.children">
                        <a role="menuitem" tabindex="-1" href="#{{ subMenu.url }}">{{ subMenu.name }}</a>
                    </li>
                </ul>
                <ul class="dropdown-menu" role="menu" ng-if="menu.type == 2">
                    <li role="presentation" ng-repeat="(collectionName, collectionId) in collectionSortedMap">
                        <a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-click="collectionMenuClick(collectionId, menu)">{{ collectionName }}</a>
                    </li>
                </ul>
            </li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <li id="fat-menu" class="dropdown">
                <a href="javascript:void(0)" id="drop3" role="button" class="dropdown-toggle" data-toggle="dropdown">{{ account }}<b class="caret"></b></a>
                <ul class="dropdown-menu" role="menu" aria-labelledby="drop3">
                    <li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-click="logout()">注销</a></li>
                </ul>
            </li>
        </ul>
    </div>
</nav>